<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:quartz="http://quartznet.sourceforge.net/JobSchedulingData" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://quartznet.sourceforge.net/JobSchedulingData" elementFormDefault="qualified" version="1.0">
  <annotation>
    <documentation>
      
      Copyright (c) 2004-2005 by OpenSymphony
      All rights reserved.
 
      Previously Copyright (c) 2001-2004 James House
	  
      And Previously Copyright Third Eye Consulting, Inc. (c) 2004
      
    </documentation>
  </annotation>
  <annotation>
    <documentation><![CDATA[
        This is the XML Schema for Job Scheduling Data.
        All xml files containing job scheduling data must indicate the
        Quartz schema by using the Quartz namespace:
        
        http://quartznet.sourceforge.net/JobSchedulingData
  
        and indicate the version of the schema by
        using the version element as shown below:

            <quartz xmlns="http://www.quartzscheduler.org/ns/quartznet"
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    xsi:schemaLocation="http://www.quartzscheduler.org/ns/quartznet
                      http://quartznet.sourceforge.net/xml/job_scheduling_data.xsd"
                    version="1.0">
              ...
            </quartz>

        The instance documents may indicate the published version of
        the schema using the xsi:schemaLocation attribute for the Quartz
        namespace with the following location:

        http://quartznet.sourceforge.net/xml/job_scheduling_data.xsd
      ]]></documentation>
  </annotation>
  <element name="quartz">
    <annotation>
      <documentation>Root level node</documentation>
    </annotation>
    <complexType>
      <sequence>
        <element name="job-listener" type="quartz:job-listenerType" minOccurs="0" maxOccurs="unbounded" />
        <element name="calendar" type="quartz:calendarType" minOccurs="0" maxOccurs="unbounded" />
        <element name="job" type="quartz:jobType" minOccurs="0" maxOccurs="unbounded" />
      </sequence>
      <attribute name="version" type="xsd:string">
        <annotation>
          <documentation>Version of the XML Schema instance</documentation>
        </annotation>
      </attribute>
      <attribute name="overwrite-existing-jobs" type="xsd:boolean" default="true">
        <annotation>
          <documentation>Whether the existing jobs will be overwritten.</documentation>
        </annotation>
      </attribute>
    </complexType>
  </element>
  <complexType name="job-listenerType">
    <annotation>
      <documentation>Define a Job Listener</documentation>
    </annotation>
    <attribute name="type" type="xsd:string" use="required">
      <annotation>
        <documentation>Job Listener type name</documentation>
      </annotation>
    </attribute>
    <attribute name="name" type="xsd:string" default="required">
      <annotation>
        <documentation>logical name for listener</documentation>
      </annotation>
    </attribute>
  </complexType>
  <complexType name="calendarType">
    <annotation>
      <documentation>Define a Calendar</documentation>
    </annotation>
    <sequence>
      <element name="name" type="xsd:string" />
      <element name="description" type="xsd:string" minOccurs="0" />
      <element name="base-calendar" type="quartz:calendarType" minOccurs="0" />
    </sequence>
    <attribute name="type" type="xsd:string" use="required">
      <annotation>
        <documentation>Calendar type name</documentation>
      </annotation>
    </attribute>
    <attribute name="replace" type="xsd:boolean" default="false">
      <annotation>
        <documentation>Flag to replace existing calendar</documentation>
      </annotation>
    </attribute>
  </complexType>
  <complexType name="jobType">
    <annotation>
      <documentation>Define a Job</documentation>
    </annotation>
    <sequence>
      <element name="job-detail" type="quartz:job-detailType" />
      <element name="trigger" type="quartz:triggerType" minOccurs="0" maxOccurs="unbounded" />
    </sequence>
  </complexType>
  <complexType name="job-detailType">
    <annotation>
      <documentation>Define a JobDetail</documentation>
    </annotation>
    <sequence>
      <element ref="quartz:name" />
      <element ref="quartz:group" />
      <element name="description" type="xsd:string" minOccurs="0" />
      <element ref="quartz:job-type" />
      <element ref="quartz:job-listener-ref" minOccurs="0" />
      <sequence minOccurs="0">
        <element ref="quartz:volatile" />
        <element ref="quartz:durable" />
        <element ref="quartz:recover" />
      </sequence>
      <element name="job-data-map" type="quartz:job-data-mapType" minOccurs="0" />
    </sequence>
  </complexType>
  <element name="name" type="xsd:string">
    <annotation>
      <documentation>Name of the JobDetail or Trigger</documentation>
    </annotation>
  </element>
  <element name="group" type="xsd:string">
    <annotation>
      <documentation>Group in which the JobDetail or Trigger resides</documentation>
    </annotation>
  </element>
  <element name="job-type" type="xsd:string">
    <annotation>
      <documentation>Fully qualified name of the Job type</documentation>
    </annotation>
  </element>
  <element name="job-listener-ref" type="xsd:string">
    <annotation>
      <documentation>logical name of the Job Listener</documentation>
    </annotation>
  </element>
  <element name="volatile" type="xsd:boolean" default="false">
    <annotation>
      <documentation>Whether the Job is volatile</documentation>
    </annotation>
  </element>
  <element name="durable" type="xsd:boolean" default="false">
    <annotation>
      <documentation>Whether the Job is durable</documentation>
    </annotation>
  </element>
  <element name="recover" type="xsd:boolean" default="false">
    <annotation>
      <documentation>Whether the Job is recoverable</documentation>
    </annotation>
  </element>
  <complexType name="job-data-mapType">
    <annotation>
      <documentation>Define a JobDataMap</documentation>
    </annotation>
    <sequence minOccurs="0" maxOccurs="unbounded">
      <element name="entry" type="quartz:entryType" />
    </sequence>
  </complexType>
  <complexType name="entryType">
    <annotation>
      <documentation>Define a JobDataMap entry</documentation>
    </annotation>
    <sequence>
      <element ref="quartz:key" />
      <element ref="quartz:value" />
    </sequence>
  </complexType>
  <element name="key" type="xsd:string">
    <annotation>
      <documentation>Define a JobDataMap key</documentation>
    </annotation>
  </element>
  <element name="value" type="xsd:string">
    <annotation>
      <documentation>Define a JobDataMap value</documentation>
    </annotation>
  </element>
  <complexType name="triggerType">
    <annotation>
      <documentation>Define a Trigger</documentation>
    </annotation>
    <choice>
      <element name="simple" type="quartz:simpleType" />
      <element name="cron" type="quartz:cronType" />
    </choice>
  </complexType>
  <complexType name="abstractTriggerType" abstract="true">
    <annotation>
      <documentation>Common Trigger definitions</documentation>
    </annotation>
    <sequence>
      <element ref="quartz:name" />
      <element ref="quartz:group" />
      <element name="description" type="xsd:string" minOccurs="0" />
      <element name="misfire-instruction" type="quartz:misfire-instructionType" minOccurs="0" />
      <element ref="quartz:calendar-name" minOccurs="0" />
      <element ref="quartz:volatile" minOccurs="0" />
    </sequence>
  </complexType>
  <simpleType name="misfire-instructionType">
    <annotation>
      <documentation>Define a Trigger Misfire Instruction</documentation>
    </annotation>
    <restriction base="xsd:string">
      <pattern value="SmartPolicy" />
      <pattern value="RescheduleNextWithExistingCount" />
      <pattern value="RescheduleNextWithRemainingCount" />
      <pattern value="RescheduleNowWithExistingRepeatCount" />
      <pattern value="RescheduleNowWithRemainingRepeatCount" />
      <pattern value="DoNothing" />
      <pattern value="FireNow" />
    </restriction>
  </simpleType>
  <element name="calendar-name" type="xsd:string">
    <annotation>
      <documentation>Define a Trigger Calendar name</documentation>
    </annotation>
  </element>
  <complexType name="simpleType">
    <annotation>
      <documentation>Define a SimpleTrigger</documentation>
    </annotation>
    <complexContent>
      <extension base="quartz:abstractTriggerType">
        <sequence>
          <sequence minOccurs="0">
            <element ref="quartz:job-name" />
            <element ref="quartz:job-group" />
          </sequence>
          <sequence minOccurs="0">
            <element ref="quartz:start-time" />
            <element ref="quartz:end-time" minOccurs="0" />
          </sequence>
          <sequence minOccurs="0">
            <element name="repeat-count" type="quartz:repeat-countType" />
            <element ref="quartz:repeat-interval" />
          </sequence>
        </sequence>
      </extension>
    </complexContent>
  </complexType>
  <element name="job-name" type="xsd:string">
    <annotation>
      <documentation>Name of the Job</documentation>
    </annotation>
  </element>
  <element name="job-group" type="xsd:string">
    <annotation>
      <documentation>Group in which the Job resides</documentation>
    </annotation>
  </element>
  <element name="start-time" type="xsd:dateTime">
    <annotation>
      <documentation>Start time of the job</documentation>
    </annotation>
  </element>
  <element name="end-time" type="xsd:dateTime">
    <annotation>
      <documentation>End time of the job</documentation>
    </annotation>
  </element>
  <simpleType name="repeat-countType">
    <annotation>
      <documentation>Number of times to repeat the Trigger (-1 for indefinite)</documentation>
    </annotation>
    <restriction base="xsd:integer">
      <minInclusive value="-1" />
    </restriction>
  </simpleType>
  <element name="repeat-interval" type="xsd:nonNegativeInteger">
    <annotation>
      <documentation>Time interval (in milliseconds) at which the Trigger should repeat</documentation>
    </annotation>
  </element>
  <complexType name="cronType">
    <annotation>
      <documentation>Define a CronTrigger</documentation>
    </annotation>
    <complexContent>
      <extension base="quartz:abstractTriggerType">
        <sequence minOccurs="0">
          <sequence>
            <element ref="quartz:job-name" />
            <element ref="quartz:job-group" />
          </sequence>
          <sequence minOccurs="0">
            <sequence minOccurs="0">
              <element ref="quartz:start-time" />
              <element ref="quartz:end-time" />
            </sequence>
            <element name="cron-expression" type="quartz:cron-expressionType" />
            <element ref="quartz:time-zone" minOccurs="0" />
          </sequence>
        </sequence>
      </extension>
    </complexContent>
  </complexType>
  <simpleType name="cron-expressionType">
    <annotation>
      <documentation>
        Cron expression (see JavaDoc for examples)

        Special thanks to Chris Thatcher (thatcher@butterfly.net) for the regular expression!
        
                  Regular expressions are not my strong point but I believe this is complete,
                  with the caveat that order for expressions like 3-0 is not legal but will pass, 
                  and month and day names must be capitalized.
                  If you want to examine the correctness look for the [\s] to denote the
                  seperation of individual regular expressions. This is how I break them up visually 
                  to examine them:
                  
                SECONDS:
                (   
                      ((([0-9] | [0-5][0-9]),)*([0-9]|[0-5][0-9]))
                    | (([0-9]|[0-5][0-9])(/|-)([0-9]|[0-5][0-9]))
                    | ([\?])
                    | ([\*])
                ) [\s]
                MINUTES:
                (   
                      ((([0-9] | [0-5][0-9]),)*([0-9]|[0-5][0-9]))
                    | (([0-9]|[0-5][0-9])(/|-)([0-9]|[0-5][0-9]))
                    | ([\?])
                    | ([\*])
                ) [\s]
                HOURS:
                (
                    ((([0-9]|[0-1][0-9]|[2][0-3]),)*([0-9]|[0-1][0-9]|[2][0-3]))
                  | (([0-9]|[0-1][0-9]|[2][0-3])(/|-)([0-9]|[0-1][0-9]|[2][0-3])) 
                  | ([\?])
                  | ([\*]) 
                ) [\s]
                DAY OF MONTH:
                (
                    ((([1-9]|[0][1-9]|[1-2][0-9]|[3][0-1]),)*([1-9]|[0][1-9]|[1-2][0-9]|[3][0-1])(C)?)
                  | (([1-9]|[0][1-9]|[1-2][0-9]|[3][0-1])(/|-)([1-9]|[0][1-9]|[1-2][0-9]|[3][0-1])(C)?)
                  | (L)
                  | ([\?])
                  | ([\*])
                )[\s]
                MONTH:
                (  
                    ((([1-9]|0[1-9]|1[0-2]),)*([1-9]|0[1-9]|1[0-2]))
                  | (([1-9]|0[1-9]|1[0-2])(/|-)([1-9]|0[1-9]|1[0-2]))
                  | (((JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC),)*(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC))
                  | ((JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)(-|/)(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC))
                  | ([\?])
                  | ([\*])
                )[\s]
                DAY OF WEEK:
                ( 
                    (([1-7],)*([1-7]))
                  | ([1-7](/|-)([1-7]))
                  | (((MON|TUE|WED|THU|FRI|SAT|SUN),)*(MON|TUE|WED|THU|FRI|SAT|SUN)(C)?)
                  | ((MON|TUE|WED|THU|FRI|SAT|SUN)(-|/)(MON|TUE|WED|THU|FRI|SAT|SUN)(C)?)
                  | (([1-7]|(MON|TUE|WED|THU|FRI|SAT|SUN))?(L)?)
                  | ([1-7]#([1-7])?)
                  | ((MON|TUE|WED|THU|FRI|SAT|SUN)#([1-7])?)
                  | ([\?])
                  | ([\*])
                )
                YEAR (OPTIONAL):
                ([\s]19[7-9][0-9]|20[0-9]{2})?         
      </documentation>
    </annotation>
    <restriction base="xsd:string">
      <pattern value="(((([0-9]|[0-5][0-9]),)*([0-9]|[0-5][0-9]))|(([0-9]|[0-5][0-9])(/|-)([0-9]|[0-5][0-9]))|([\?])|([\*]))[\s](((([0-9]|[0-5][0-9]),)*([0-9]|[0-5][0-9]))|(([0-9]|[0-5][0-9])(/|-)([0-9]|[0-5][0-9]))|([\?])|([\*]))[\s](((([0-9]|[0-1][0-9]|[2][0-3]),)*([0-9]|[0-1][0-9]|[2][0-3]))|(([0-9]|[0-1][0-9]|[2][0-3])(/|-)([0-9]|[0-1][0-9]|[2][0-3]))|([\?])|([\*]))[\s](((([1-9]|[0][1-9]|[1-2][0-9]|[3][0-1]),)*([1-9]|[0][1-9]|[1-2][0-9]|[3][0-1])(C)?)|(([1-9]|[0][1-9]|[1-2][0-9]|[3][0-1])(/|-)([1-9]|[0][1-9]|[1-2][0-9]|[3][0-1])(C)?)|(L)|([\?])|([\*]))[\s](((([1-9]|0[1-9]|1[0-2]),)*([1-9]|0[1-9]|1[0-2]))|(([1-9]|0[1-9]|1[0-2])(/|-)([1-9]|0[1-9]|1[0-2]))|(((JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC),)*(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC))|((JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)(-|/)(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC))|([\?])|([\*]))[\s]((([1-7],)*([1-7]))|([1-7](/|-)([1-7]))|(((MON|TUE|WED|THU|FRI|SAT|SUN),)*(MON|TUE|WED|THU|FRI|SAT|SUN)(C)?)|((MON|TUE|WED|THU|FRI|SAT|SUN)(-|/)(MON|TUE|WED|THU|FRI|SAT|SUN)(C)?)|(([1-7]|(MON|TUE|WED|THU|FRI|SAT|SUN))?(L)?)|([1-7]#([1-7])?)|([\?])|([\*]))([\s]19[7-9][0-9]|20[0-9]{2})?" />
    </restriction>
  </simpleType>
  <element name="time-zone" type="xsd:string">
    <annotation>
      <documentation>Valid Timezone ID</documentation>
    </annotation>
  </element>
</schema>